/*
 * TaperIDMapperFrame.java
 *
 * Created on Dec 16, 2011, 12:01:35 AM
 */
package gui;

/**
 *
 * @author suzann
 */

/*
 * Import Java Classes
 */

import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JOptionPane;
import javax.swing.JTextField;

import util.Activity;
import util.Authentication;
import util.Constants;
import util.PLCSend;
import util.Validator;

import db.DatabaseManager;
import db.entity.Pressurevalue;
import db.entity.TaperMap;

public class TaperIDMapperFrame extends javax.swing.JFrame {

    /** Creates new form TaperIDMapperFrame */
    public TaperIDMapperFrame() {
        initComponents();
        setDefaultValue();
        toggleTextAndButtons(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jtxL1 = new javax.swing.JTextField();
        jtxR1 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jtxL2 = new javax.swing.JTextField();
        jtxR2 = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jtxL3 = new javax.swing.JTextField();
        jtxR3 = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jtxL4 = new javax.swing.JTextField();
        jtxR4 = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jtxL5 = new javax.swing.JTextField();
        jtxR5 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jtxL6 = new javax.swing.JTextField();
        jtxR6 = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jtxL7 = new javax.swing.JTextField();
        jtxR7 = new javax.swing.JTextField();
        jbtSave = new javax.swing.JButton();
        jbtCancel = new javax.swing.JButton();
        jbtEdit = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("Station");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel2.setText("Left Taper");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel3.setText("Right Taper");

        jLabel4.setText("01");

        jLabel5.setText("02");

        jLabel6.setText("03");

        jLabel7.setText("04");

        jLabel8.setText("05");

        jLabel9.setText("06");

        jLabel10.setText("07");

        jbtSave.setText("Save");
        jbtSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtSaveActionPerformed(evt);
            }
        });

        jbtCancel.setText("Cancel");
        jbtCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtCancelActionPerformed(evt);
            }
        });

        jbtEdit.setText("Edit");
        jbtEdit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtEditActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6)
                            .addComponent(jLabel8)
                            .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtxL2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtxL1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2)
                            .addComponent(jtxL3, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtxL4, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtxL5, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtxL6, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtxL7, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(27, 27, 27))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jbtEdit)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtSave)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtCancel)
                        .addGap(33, 33, 33)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                		.addComponent(jtxR6, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtxR5, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtxR4, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtxR3, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtxR2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3)
                        .addComponent(jtxR1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtxR7, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(30, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jtxL1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxR1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jtxR2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxL2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jtxL3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxR3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtxL4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxR4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jtxL5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxR5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtxL6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jtxR6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtxL7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(jtxR7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtEdit)
                    .addComponent(jbtSave)
                    .addComponent(jbtCancel))
                    .addContainerGap(97, Short.MAX_VALUE))
        );
        
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-418)/2, (screenSize.height-388)/2, 418, 388);
    }// </editor-fold>

    private void jbtSaveActionPerformed(java.awt.event.ActionEvent evt) {    
    	saveTaperValue();
    }                                       

    private void jbtCancelActionPerformed(java.awt.event.ActionEvent evt) {
    	resetTaperValue();
    	toggleTextAndButtons(false);
    }

    private void jbtEditActionPerformed(java.awt.event.ActionEvent evt) {
    	editTaperValue();
    }
    
    String[] taperID_left = new String[7];
    String[] taperID_right = new String[7];
    List<TaperMap> taperLS;
    DatabaseManager dm;
    private void setDefaultValue()
    {
    	if(dm == null)
    		dm = new DatabaseManager();
    	
    	taperLS = dm.listTaperMap();
    	for(TaperMap tItem : taperLS)
    	{
    		int stationNo = Integer.parseInt(tItem.getStationName());
    		if(stationNo > 7)
    			continue;
    		
    		String leftTaper = tItem.getLeftTaper();
    		String rightTaper = tItem.getRightTaper();
    		    		
    		taperID_left[stationNo-1] = leftTaper;
    		taperID_right[stationNo-1] = rightTaper;
    		switch(stationNo)
    		{
    		case 1:
    			jtxL1.setText(leftTaper);
    			jtxR1.setText(rightTaper);
    			break;
    		case 2:
    			jtxL2.setText(leftTaper);
    			jtxR2.setText(rightTaper);
    			break;
    		case 3:
    			jtxL3.setText(leftTaper);
    			jtxR3.setText(rightTaper);
    			break;
    		case 4:
    			jtxL4.setText(leftTaper);
    			jtxR4.setText(rightTaper);
    			break;
    		case 5:
    			jtxL5.setText(leftTaper);
    			jtxR5.setText(rightTaper);
    			break;
    		case 6:
    			jtxL6.setText(leftTaper);
    			jtxR6.setText(rightTaper);
    			break;
    		case 7:
    			jtxL7.setText(leftTaper);
    			jtxR7.setText(rightTaper);
    			break;
    		}
    	}
    }
    
    private void editTaperValue()
    {
        // When user trying to Edit Pressure Value, authenticate the user first.
        // If Autehnticated, save the value, else prompt to enter the user again
        String username = null;
        boolean isEdit = false;
        do
        {
            username = Authentication.authenticateUser();
            if(username.equals("Invalid"))
            {
                JOptionPane.showMessageDialog(this, "Your username is invalid.\nPlease enter your username again.", "Authentication Failure", JOptionPane.WARNING_MESSAGE);
                System.out.println("Authentication failure attempted."); //Can be included into activity log later.
                continue;
            }
            else if (username.equals("Exit"))
            {
                System.out.println("Edit pressure values action terminated."); //Can be included into activity log later.
                break;
            }
            else
            {
                if (username != null)
                {
                    isEdit = true;
                    userID = username;
                    //After Authentication, set all the fields to edittable.
                    toggleTextAndButtons(true);
                }
            }
        }while(isEdit == false);
    }
    
    private void saveTaperValue()
    {
    	int stationNo;
    	
        //get all the inputs and validate them
        Container c = this.getContentPane();
        Component[] comps = c.getComponents();
        ArrayList<Component> compList = new ArrayList <Component>();
        
        //looping textfields for validation
        for (Component comp : comps)
        {
            if (comp instanceof JTextField)
            {
                compList.add(comp);
            }
        }
        
        //validate the text fields
        boolean isBlank = Validator.validateBlank(compList);
        if ( isBlank == false )
        {
        	List<TaperMap> changeLS = new ArrayList<TaperMap>();
            for(TaperMap taperObj : taperLS)
            {
                    stationNo = Integer.parseInt(taperObj.getStationName());
                    
                    if(stationNo > 7)
                    	continue;
                    
                    String taperLeft ="", taperRight = "";
                    switch(stationNo)
                    {
                    case 1: 
                    	taperLeft = jtxL1.getText();
                    	taperRight = jtxR1.getText();
                    	break;
                    case 2: 
                    	taperLeft = jtxL2.getText();
                    	taperRight = jtxR2.getText();
                    	break;
                    case 3: 
                    	taperLeft = jtxL3.getText();
                    	taperRight = jtxR3.getText();
                    	break;
                    case 4: 
                    	taperLeft = jtxL4.getText();
                    	taperRight = jtxR4.getText();
                    	break;
                    case 5: 
                    	taperLeft = jtxL5.getText();
                    	taperRight = jtxR5.getText();
                    	break;
                    case 6: 
                    	taperLeft = jtxL6.getText();
                    	taperRight = jtxR6.getText();
                    	break;
                    case 7: 
                    	taperLeft = jtxL7.getText();
                    	taperRight = jtxR7.getText();
                    	break;
                    }
                    
                    if(!taperLeft.equals(taperID_left[stationNo -1]) || !taperRight.equals(taperID_right[stationNo -1]))
                    {                    	
                    	taperID_left[stationNo -1] = taperLeft;
        				taperID_right[stationNo -1] = taperRight;
                    
                    	taperObj.setLeftTaper(taperLeft);
                    	taperObj.setRightTaper(taperRight);
                    	
                    	changeLS.add(taperObj);
                    }
            }
            //Update the Taper ID Values
            //set the textfileds and button to unedittable
            //Then retrive the value from database again
            dm.updateTaperMap(changeLS);
            
            Activity.log("Update Taper ID Mapping", userID, "");
            
            toggleTextAndButtons(false);
            setDefaultValue();
            NewSPCFrame.updateTaperList();
            TendChartFrame.updateDCMap();
            
            //Show the successful dialog message
            JOptionPane.showMessageDialog(null, "Taper ID successfully updated.", "Update Successfully", JOptionPane.PLAIN_MESSAGE);
        }
    }
    
    private void resetTaperValue()
    {
    	jtxL1.setText(taperID_left[0].toString());
    	jtxL2.setText(taperID_left[1].toString());
    	jtxL3.setText(taperID_left[2].toString());
    	jtxL4.setText(taperID_left[3].toString());
    	jtxL5.setText(taperID_left[4].toString());
    	jtxL6.setText(taperID_left[5].toString());
    	jtxL7.setText(taperID_left[6].toString());
    	jtxR1.setText(taperID_right[0].toString());
    	jtxR2.setText(taperID_right[1].toString());
    	jtxR3.setText(taperID_right[2].toString());
    	jtxR4.setText(taperID_right[3].toString());
    	jtxR5.setText(taperID_right[4].toString());
    	jtxR6.setText(taperID_right[5].toString());
    	jtxR7.setText(taperID_right[6].toString());
    }
    
    private void toggleTextAndButtons(boolean isEdittable)
    {
        //If user select 'save', the isEdittable should be false
        //else if user select 'edit', the isEdittable should be true
        jtxL1.setEditable(isEdittable);
        jtxL2.setEditable(isEdittable);
        jtxL3.setEditable(isEdittable);
        jtxL4.setEditable(isEdittable);
        jtxL5.setEditable(isEdittable);
        jtxL6.setEditable(isEdittable);
        jtxL7.setEditable(isEdittable);
        
        jtxR1.setEditable(isEdittable);
        jtxR2.setEditable(isEdittable);
        jtxR3.setEditable(isEdittable);
        jtxR4.setEditable(isEdittable);
        jtxR5.setEditable(isEdittable);
        jtxR6.setEditable(isEdittable);
        jtxR7.setEditable(isEdittable);
        
        //set the availability of button
        jbtSave.setEnabled(isEdittable);
        jbtCancel.setEnabled(isEdittable);
        jbtEdit.setEnabled(!isEdittable);
    }
    
    public void addNotify() {
        super.addNotify();
        // Buffer
        createBufferStrategy(2);           
        //BufferStrategy strategy = getBufferStrategy();
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TaperIDMapperFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TaperIDMapperFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TaperIDMapperFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TaperIDMapperFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new TaperIDMapperFrame().setVisible(true);
            }
        });
    }
    /****************************************************************************
     * INTERNAL OPERATIONS : THE FRAME
     ****************************************************************************/
    
    /**
     * Prompts up a confirmation dialog to confirm the exit action.
     * Upon confirmation, dispose the frame.
     */
    private void onExit()
    {
            this.dispose();
            resetTaperValue();
        	toggleTextAndButtons(false);
    }
    
    /**
     * This is a hack for user to click on the 'x' button on window
     */
    protected void processWindowEvent(WindowEvent we)
    {
            if(we.getID() == WindowEvent.WINDOW_CLOSING)
                    onExit();
    }
    
    // Variables declaration - do not modify
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JButton jbtCancel;
    private javax.swing.JButton jbtEdit;
    private javax.swing.JButton jbtSave;
    private javax.swing.JTextField jtxL1;
    private javax.swing.JTextField jtxL2;
    private javax.swing.JTextField jtxL3;
    private javax.swing.JTextField jtxL4;
    private javax.swing.JTextField jtxL5;
    private javax.swing.JTextField jtxL6;
    private javax.swing.JTextField jtxL7;
    private javax.swing.JTextField jtxR1;
    private javax.swing.JTextField jtxR2;
    private javax.swing.JTextField jtxR3;
    private javax.swing.JTextField jtxR4;
    private javax.swing.JTextField jtxR5;
    private javax.swing.JTextField jtxR6;
    private javax.swing.JTextField jtxR7;
    // End of variables declaration
    
    private String userID;
}
